package org.jeecg.modules.my.zhisk.vo;

import lombok.Data;
import org.jeecg.modules.my.zhisk.entity.ZhiskLanm;

import java.util.ArrayList;
import java.util.List;

@Data
public class ZhiskTreeModel {
    /** 对应DxZhiskLanm中的id字段,前端数据树中的key*/
    private String key;

    /** 对应DxZhiskLanm中的id字段,前端数据树中的value*/
    private String value;

    /** 对应DxZhiskLanm字段,前端数据树中的title*/
    private String title;

    private boolean isLeaf;

    private String id;

    private String parentId;

    private List<ZhiskTreeModel> children = new ArrayList<>();

    public ZhiskTreeModel(ZhiskLanm zhiskLanm) {
        if(zhiskLanm != null) {
            this.key = zhiskLanm.getId();
            this.value = zhiskLanm.getId();
            this.title = zhiskLanm.getLanmmc();

            this.id = zhiskLanm.getId();
            this.parentId = zhiskLanm.getParentId();
            this.sequence = zhiskLanm.getSequence();
        }
    }

    Float sequence;
}
